//sigdemo.c
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#include <signal.h>

void sigHandler(int signalNum)
{
    printf("The sign no is:%d\n", signalNum);
    signal(SIGINT, sigHandler); // 重新设置
}

int main()
{
    signal(SIGINT, sigHandler);
    signal(SIGQUIT, SIG_IGN); // 忽略^\
    while (true)
        sleep(1);
    return 0;
}
